{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "bafc7194-8da8-4048-9f65-83c4f10079fe",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(10, 10, 3)\n"
     ]
    },
    {
     "data": {
      "image/png": "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2bIlzj333NGeCYBx4LQC09vbG7fcckssWrTocx87MDAQ1Wp12AJg/Kv5lslPP/10HDhwIPbu3Tuix/f19cUPf/jDmgcDoLnVdAbT398fK1asiCeffDImTZo0on3uu+++qFQqJ1Z/f/9pDQpAcykVRVGM9MG//e1v4xvf+Ea0trae2DY4OBilUilaWlpiYGBg2P/7LNVqNcrlclQiovO0x4b/MfJv4bNbqVTvCRgHqhFRjohKpRKdnaf+KV7TW2Q33HBDvPHGG8O2LV26NGbPnh333nvv58YFgLNHTYHp6OiIuXPnDtt2zjnnxJQpUz61HYCzm7/kByBFzb9F9v975ZVXRmEMAMYbZzAApBAYAFIIDAApBAaAFAIDQAqBASCFwACQQmAASCEwAKQQGABSCAwAKc74s8hOV7leT3wSpQa8V0YNt+o5qzlKI9N43+GMd85gAEghMACkEBgAUggMACkEBoAUAgNACoEBIIXAAJBCYABIITAApBAYAFIIDAApBAaAFAIDQAqBASCFwACQQmAASCEwAKQQGABSCAwAKQQGgBQCA0AKgQEghcAAkEJgAEghMACkEBgAUggMACkEBoAUAgNACoEBIIXAAJBCYABIITAApBAYAFIIDAApJtR7gEZRFEW9R2gKjXicSqVSvUdoCl47xpozGABSCAwAKQQGgBQCA0AKgQEghcAAkEJgAEghMACkEBgAUggMACkEBoAUAgNACoEBIIXAAJCi5sC88847cccdd8SUKVOivb09Lr/88ti3b1/GbAA0sZruB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9q7d2889thjccUVV9R7lIbzwQcfRE9PT3zhC1+Il156Kf7yl7/ET37ykzj33HPrPVpD2bBhQ2zatCk2btwYf/3rX2PDhg3x4x//OB555JF6j1Y3TflrygsXLoz58+fHxo0bI+I/n2/W1dUVd999d6xevbrO0zWm9957L6ZOnRrbt2+P66+/vt7jNJQPP/wwrr766vjpT38aP/rRj+Kqq66Khx9+uN5jNYzVq1fHn/70p/jjH/9Y71Ea2te+9rWYNm1a/PznPz+x7Zvf/Ga0t7fHr371qzpOVj9Ndwbz8ccfx/79+2PRokUntrW0tMSiRYti165ddZyssVUqlYiImDx5cp0naTy9vb1xyy23DPue4r+ef/756O7ujttvvz2mTp0a8+bNiy1bttR7rIZz3XXXxbZt2+LQoUMREfH666/Hzp074+abb67zZPUz5h92eabef//9GBwcjGnTpg3bPm3atPjb3/5Wp6ka29DQUKxcuTJ6enpi7ty59R6noTz99NNx4MCB2Lt3b71HaVhvv/12bNq0KVatWhXf//73Y+/evbF8+fKYOHFiLFmypN7jNYzVq1dHtVqN2bNnR2trawwODsa6deti8eLF9R6tbpouMNSut7c33nzzzdi5c2e9R2ko/f39sWLFinj55Zdj0qRJ9R6nYQ0NDUV3d3esX78+IiLmzZsXb775ZvzsZz8TmP/x61//Op588snYunVrzJkzJw4ePBgrV66MCy+88Kw9Tk0XmPPOOy9aW1vj6NGjw7YfPXo0zj///DpN1biWLVsWL774YuzYsWNUb5MwHuzfvz/efffduPrqq09sGxwcjB07dsTGjRtjYGAgWltb6zhhY7jgggvisssuG7bt0ksvjd/85jd1mqgxfe9734vVq1fHd77znYiIuPzyy+Of//xn9PX1nbWBabprMBMnToxrrrkmtm3bdmLb0NBQbNu2La699to6TtZYiqKIZcuWxbPPPht/+MMfYtasWfUeqeHccMMN8cYbb8TBgwdPrO7u7li8eHEcPHhQXP6vnp6eT/2K+6FDh+Kiiy6q00SN6aOPPvrUDbhaW1tjaGioThPVX9OdwURErFq1KpYsWRLd3d2xYMGCePjhh+P48eOxdOnSeo/WMHp7e2Pr1q3x3HPPRUdHRxw5ciQi/nOjoPb29jpP1xg6Ojo+dU3qnHPOiSlTprhW9T/uueeeuO6662L9+vXxrW99K/bs2RObN2+OzZs313u0hnLrrbfGunXrYsaMGTFnzpx47bXX4qGHHoo777yz3qPVT9GkHnnkkWLGjBnFxIkTiwULFhS7d++u90gNJSI+cz3++OP1Hq2hfeUrXylWrFhR7zEazgsvvFDMnTu3aGtrK2bPnl1s3ry53iM1nGq1WqxYsaKYMWNGMWnSpOLiiy8u7r///mJgYKDeo9VNU/4dDACNr+muwQDQHAQGgBQCA0AKgQEghcAAkEJgAEghMACkEBgAUggMACkEBoAUAgNACoEBIMX/ASILB1ssSKuuAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from skimage import io\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# 读取图像\n",
    "img = io.imread('x.jpg')\n",
    "print(img.shape)\n",
    "\n",
    "# 获取图像的尺寸\n",
    "h, w, c = img.shape\n",
    "\n",
    "# 计算中点\n",
    "midpoint = h // 2\n",
    "\n",
    "# 遍历图像的上半部分\n",
    "for i in range(w):\n",
    "    for j in range(midpoint):\n",
    "        # 检查当前像素是否为白色\n",
    "        if img[j, i].sum() != 255 * 3:\n",
    "            img[j, i][0] = 255  # 设置红色通道为255\n",
    "            img[j, i][1] = 0    # 设置绿色通道为0\n",
    "            img[j, i][2] = 0    # 设置蓝色通道为0\n",
    "\n",
    "# 显示处理后的图像\n",
    "plt.imshow(img)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "65be79d7-1876-4429-a9ef-e19c9fb64a7b",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
